home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Publication 5
/
Publication_05_19xx_High-Tech_de_Side_A.d64
/
earthworms
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
3KB
|
93 lines
1 rem earthworms
100 mc=54272:vc=53248:pokevc+32,6:pokevc+33,15
110 printchr$(147):m=((peek(53272)and240)/16)*1024:c=55296
150 print"[144] earthworms [146]";
155 gosub2300
160 print"as you crawl through the dirt you must eat algae ([209][144]) and avoid"
170 print"sharp pebbles ([218][144])."
175 print"hitting pebbles or the border of the"
180 print"screen or crossing a previous tunnel will end the game."
185 gosub2400
190 print"control direction with the joystick."
200 print"ten points for each algae ball you eat."
210 gosub2500:gosub2000
220 printchr$(147);" enter skill level:":print" 1[146] beginner"
225 print" -to-":print" 5[146] advanced"
230 getx$:ifx$=""then230
240 sc=0:sl=val(x$):ifsl<1orsl>5then230
245 lt=(11-(sl*2)):iflt>7thenlt=7
250 printchr$(147):fory=1to(sl*6):gosub2100:pokem+x,90:pokec+x,6:nexty
260 ac=sl*20:fory=1toac:gosub2100:pokem+x,81:pokec+x,5:nexty
270 h1=20:v1=12:pokem+500,160:pokec+500,2
275 :
280 h2=0:v2=0:x=1:ifrnd(1)>.5thenx=-1
290 lc=0:h2=x:ifrnd(1)>.5thenh2=0:v2=x
300 h3=0:v3=0:gosub2200:ifv3<>0orh3<>0thenh2=h3:v2=v3:goto360
340 lc=lc+1:iflc<ltthen300
350 lc=0
360 h1=h1+h2:v1=v1+v2:ifh1<0orh1>39orv1<0orv1>24then700
370 x=peek(m+h1+(v1*40))
380 ifx=32orx=81thenpokem+h1+(v1*40),160:pokec+h1+(v1*40),2:goto410
390 ifx=160orx=90then700
400 goto300
410 ifx=32then300
420 rem ***** eat algae
430 pokemc+0,0:pokemc+1,0:pokemc+24,15
440 forx=50to10step-10
445 pokemc+1,x:pokemc+4,129
450 fory=1to10:nexty:pokemc+4,128:nextx
460 pokemc+24,0
470 sc=sc+10:ac=ac-1
480 ifac<1then250
490 goto300
700 rem ***** game over
701 pokemc+0,0:pokemc+1,20:pokemc+4,17:pokemc+24,15
702 fory=1to500:nexty:pokemc+4,16:pokemc+24,0
710 printchr$(147);" game over![146]"
720 print" score =";sc
730 print" replay? (y[146] or n[146])"
740 getx$:ifx$=""then740
750 ifx$="y"then220
760 ifx$<>"n"then740
770 gosub2400:gosub2500
780 printchr$(147)
790 end
2000 print" (press any key to start)"
2010 getx$:ifx$=""then2010
2020 return
2100 x=int(rnd(1)*1000):ifpeek(m+x)<>32then2100
2110 return
2200 rem ***** read joystick
2210 x=peek(56321)
2220 if(xand1)=0thenv3=-1
2230 if(xand2)=0thenv3=1
2240 if(xand4)=0thenh3=-1
2250 if(xand8)=0thenh3=1
2260 return
2300 rem ***** load sprite definitions
2310 forx=832to832+63:pokex,0:nextx
2320 forx=896to896+63:readz:pokex,z:nextx
2330 forx=832+48to832+56:readz:pokex,z:nextx:return
2400 rem ***** setup for sprite & notes
2410 forx=54272to54296:pokex,0:nextx
2420 pokemc+1,10:pokemc+4,17:pokemc+5,15
2430 pokemc+6,15
2440 pokevc+0,0:pokevc+1,200:pokevc+16,0
2450 pokevc+23,1:pokevc+28,0:pokevc+29,0
2460 pokevc+39,2:poke2040,13
2470 return
2500 rem ***** draw sprite
2510 pokemc+24,15:pokevc+21,1:x=5:z=25
2520 poke2040,13:fory=1to50:nexty:pokemc+4,16
2525 pokevc+0,z:z=z+10
2530 poke2040,14
2540 pokemc+1,x:x=x+3:pokemc+4,17
2550 ifz=265thenpokevc+0,0:pokevc+16,1:z=0
2560 ifz<>100then2520
2570 pokemc+24,0:pokevc+21,0
2580 return
3000 data0,62,0,0,99,0,0,99,0,0,65,0,0,193,128,0,193,128,0,128,128,1,128,192
3010 data1,128,192,1,0,64,3,0,96,3,0,96,2,0,32,6,0,48,6,0,48,4,0,16,4,0
3020 data16,4,0,16,252,0,31,0,0,0,0,0,0,0
3030 data0,60,0,0,102,0,255,195,255